<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../common/taglibs.jsp"%>
<%@ include file="../jgpt/jgpt_authority.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>广东省网上办事大厅 - 珠海分厅 - 网上办事</title>
		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<meta http-equiv="expires" content="0" />
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
		<meta http-equiv="description" content="This is my page" />
		<link href="../css/common.css" rel="stylesheet" type="text/css" />
		<link href="../static/css/wsbs.css" rel="stylesheet" type="text/css" />
		<link href="../static/css/jquery-ui-1.8.2.custom.css" rel="stylesheet" type="text/css" media="screen" />
		<link href="../static/css/ui.jqgrid.css" rel="stylesheet" type="text/css" media="screen" />
		<link href="../static/css/ui.jqgrid.modify.fwpt.css" rel="stylesheet" type="text/css" />
		<link rel=stylesheet type=text/css href="../static/css/jdsubway.css"/>
		<link rel=stylesheet type=text/css href="../static/css/pop.css"/>
		<script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script>
		<script src="../js/i18n/grid.locale-cn.js" type="text/javascript"></script>
		<script src="../js/jquery.jqGrid.min.js" type="text/javascript"></script>
		<script src="../js/commonInChildPage.js" type=text/javascript></script>
		<script type="text/javascript" src="../js/pop.js"></script>
		<style type="text/css">
			#left {width: 180px;float: left;background-color: #e6f1fd;
			}
			.tab_menu_1000 li a {color: #02719F;font-weight: normal;}
			
			.tab_menu_1000 LI.hover a {BACKGROUND-POSITION: 0px -30px;COLOR: #fff}
		</style>
		<script type="text/javascript">
			
		</script>
	</head>
	<body>
		<jsp:include page="../include/head.jsp" />
		<div class=position>
			<strong>
				<table id=wypy border=0 cellSpacing=0 cellPadding=0 width=373>
					<tbody>
						<tr>
							<td class=xinxin_font height=20 vAlign=bottom width=170 align=right>本窗口服务星级评定：</td>
							<td onmouseover=rate(this,event) vAlign=center width=140
								align=left>
								<img title=很烂 src="../images/star_2.png" width=20 />
								<img title=一般 src="../images/star_2.png" width=20 />
								<img title=还好 src="../images/star_2.png" width=20 />
								<img title=较好 src="../images/star_2.png" width=20 />
								<img title=很好 src="../images/star_2.png" width=20 />
							</td>
							
							<td class="xinxin_font" width="40"  height="20"
								align="right">
								<a href="${pageContext.request.contextPath}/jgpt_logout.do">退出&nbsp;&nbsp;&nbsp;</a>
							</td>
							
						</tr>
					</tbody>
				</table>您现在的位置：</strong>
				<a href="http://wsbs.zhzw.gov.cn/">首 页</a> &gt;
				<a href="http://wsbs.zhzw.gov.cn/wsbs/">网上办事</a> &gt;
				<a href="../index.do">公共资源交易大厅</a>&gt; 
				<a href="../login.do">监管平台</a>&gt;
				建设工程项目进度查看
		</div>
		<div class=cl></div>
		<div class="main t10 clearfix">
			<!-- left -->
			<div class="main_l" style="height: 575px">
				<div class="left_nav">
					<div class="left_nav_tit">
						<a href="#">综合监管</a>
					</div>
					<div class="bar_list">
						<h5><span>监管信息</span></h5>
						<ul id="ChildMenu1">
							 <c:forEach items="${authList}" var="p" >
								<li class="${p.currentStyleClass}">
									<a href="${p.menuUrl}" class="${p.currentStyleClass}">${p.menuName}</a>
								</li>
							 </c:forEach>
						</ul>
					</div>
				</div>
				<div class="clear"></div>
			</div>
			<!-- left end -->
			<!-- right -->
			<div class="main_r" style="padding-top: 0px">
				<div class="right_box">
					<div class="content-box" style="width: 800px; height: auto; margin-bottom: 10px">
						<div class="content-box_tit">建设工程项目进度查看</div>
						<!-- 建设工程-->
						<div>
							<table id="projectlist"></table>
							<div id="pprojectlist"></div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class=cb></div>
		<div style="display: none;">

			<div id="simTestContent" class="simScrollCont">

				<div class="mainlist">
					<div class="w">
						<!--进度条-->
						<div class="section5" id="process">
							<div class="node" id="noticeNode">
								<ul>
									<li class="tx1"></li>
									<li class="tx2">公告发布</li>
									<li class="tx3" id="track_time_0"></li>
								</ul>
							</div>
							<div class="proce" id="noticeProce">
								<ul>
									<li class="tx1"></li>
								</ul>
							</div>
							<div class="node"  id="enrollNode">
								<ul>
									<li class="tx1"></li>
									<li class="tx2">报名截止</li>
									<li class="tx3" id="track_time_1"></li>
								</ul>
							</div>
							<div class="proce"  id="enrollProce">
								<ul>
									<li class="tx1"></li>
								</ul>
							</div>
							<div class="node" id="openBidNode">
								<ul>
									<li class="tx1"></li>
									<li class="tx2">投标截止/开标</li>
									<li class="tx3" id="track_time_2"></li>
								</ul>
							</div>
							<div class="proce" id="openBidProce">
								<ul>
									<li class="tx1"></li>
								</ul>
							</div>
							<div class="node" id="resultStartNode">
								<ul>
									<li class="tx1"></li>
									<li class="tx2">结果公示</li>
									<li class="tx3" id="track_time_3"></li>
								</ul>
							</div>
							<div class="proce" id="resultStartProce">
								<ul>
									<li class="tx1"></li>
								</ul>
							</div>
							<div class="node" id="resultEndNode">
								<ul>
									<li class="tx1"></li>
									<li class="tx2">结束</li>
									<li class="tx3" id="track_time_4"></li>
								</ul>
							</div>
						</div>
					</div>
					<div class="w"></div>
				</div>
				<div class="btnbox">
					<input type="button" id="confirmTerm" value="关闭" onClick="confirmTerm(1);" class="confirmBtn" />
				</div>
			</div>
		</div>
		<jsp:include page="../include/bottom.jsp" />

		<script type="text/javascript">
	jQuery("#projectlist").jqGrid({
		datatype : "json",
		url : "load_jgpt_page_data.do",
		jsonReader : {
			root : "result",
			page : "currentPage",
			total : "pageCount",
			records : "totalCount"
		},
		height : 'auto',
		width : 800,
		rowNum : 20,
		rowList : [ 5, 10, 15, 20],
		colNames : [ '项目编号', '项目名称', '项目分类', '预算价', '操作列', 'id' ],
		colModel : [ 
			{name : 'projectCode',index : 'projectCode',width : 200,align : "left",sortable : false},
			{name : 'projectName',index : 'projectName',width : 320,align : "left",sortable : false},
			{name : 'projectType',index : 'projectType',width : 160,align : "center",sortable : false}, 
			{name : 'ysj',index : 'ysj',width : 80,align : "center",sortable : false}, 
			{name : 'operation',index : 'operation',width : 80,align : "center",sortable : false,formatter : formatUrl},
			{name : 'id',index : 'id',width : 100,align : "center",sortable : false,hidden : true}
		],
		pager : "#pprojectlist",
		viewrecords : true,
		toolbar : [ true, "top" ]
	});

	function formatUrl(cellvalue, options, rowObject) {
		var returnStr = "<a href='javascript:void(0);'";
			returnStr += " onClick=getProjectData('"+rowObject.id+"','"+rowObject.projectName+"')>";
			returnStr += cellvalue;
			returnStr += "</a>";
		return returnStr;
	}

	$("#t_projectlist").css("height", "30px");
	var searchContent = "<div class='d_search_fr'>项目名称：<input type='text' size='20' id='projectName'/>&nbsp;"
			+ "<input type='submit' name='Submit' id='searchButton' value='搜 索' class='input_button_small'/>&nbsp;</div>";

	$("#t_projectlist").append(searchContent);
	$(document).ready(function() {
		$("#searchButton").click(function() {
			jQuery("#projectlist").jqGrid().setGridParam({
				postData : {
					searchText : function() {
						return encodeURI($("#projectName").val());
					},
					prjType : function() {
						return $("#select_search").val();
					}
				}
			}).trigger("reloadGrid");
		});
	});
	function getProjectData(prjId,prjName){
		resetProcess();
		$.post("get_project_data.do",{id:prjId},
		  function(data){
		 	var noticeDate = data.jgptProject.noticePublishDate;
			var enrollEndDate =  data.jgptProject.enrollEndDate;
		  	var openBidDate = data.jgptProject.openBidDate;
		  	var resultStartDate = data.jgptProject.resultStartDate;
		  	var resultEndDate =  data.jgptProject.resultEndDate;
		  	var nowDate = new Date(data.nowDate);
		 
		  $("#track_time_0").html(convertDate(noticeDate));
		  $("#track_time_1").html(convertDate(enrollEndDate));
		  $("#track_time_2").html(convertDate(openBidDate));
		  $("#track_time_3").html(convertDate(resultStartDate));
		  $("#track_time_4").html(convertDate(resultEndDate));
		  
		  var bigDate = "2045/12/11 12:11:23";
		  if(nowDate - new Date(resultEndDate||bigDate) > 0){
		  		setProcess("ready","done","ready","done","ready","done","ready","done","ready");
		  }else if(nowDate - new Date(resultStartDate||bigDate) > 0){
		  		setProcess("ready","done","ready","done","ready","done","ready","doing","wait");
		  }else if(nowDate - new Date(openBidDate||bigDate) > 0){
		  		setProcess("ready","done","ready","done","ready","doing","wait","wait","wait");
		  }else if(nowDate - new Date(enrollEndDate||bigDate) > 0){
		  		setProcess("ready","done","ready","doing","wait","wait","wait","wait","wait");
		  }else if(nowDate - new Date(noticeDate||bigDate) > 0){
		   		setProcess("ready","doing","wait","wait","wait","wait","wait","wait","wait");
		  }else{
		  		setProcess("wait","wait","wait","wait","wait","wait","wait","wait","wait");
		  }
		  
		  $.popPanel.tipsWindown("项目名称："+prjName, "id:simTestContent", 950, 155,
						"true", "", "true", "simTestContent");
		  },"json");//这里返回的类型有：json,html,xml,text
	}
	
	function convertDate(date){
		if(!date){
			return "暂无";
		}else{
			return date.split(" ")[0]+"<br/>"+date.split(" ")[1];
		}
	}
	function setProcess(c1,c2,c3,c4,c5,c6,c7,c8,c9){
		$("#noticeNode").addClass(c1);
  		$("#noticeProce").addClass(c2);
  		$("#enrollNode").addClass(c3);
  		$("#enrollProce").addClass(c4);
  		$("#openBidNode").addClass(c5);
  		$("#openBidProce").addClass(c6);
  		$("#resultStartNode").addClass(c7);
  		$("#resultStartProce").addClass(c8);
  		$("#resultEndNode").addClass(c9);
	}
	/**重置进度图样式*/
	function resetProcess(){
		/**$("#noticeNode,#enrollNode,#openBidNode,#resultStartNode,#resultStartNode,#resultEndNode").attr("class","node");
		$("#noticeProce,#enrollProce,#openBidProce,#openBidProce,#resultStartProce").attr("class","proce");*/
		$(".node").attr("class","node");
		$(".proce").attr("class","proce");
	}
	function confirmTerm(s) {
		$.popPanel.closeWindown();
	}
</script>

	</body>
</html>

